/*
** 1552.c
** 
** Made by (seakage2h)
** Login   <seakage2h@seakage2h-ubuntu>
** 
** Started on  Mon Sep 22 18:49:31 2008 seakage2h
** Last update Sun May 12 01:17:25 2002 Speed Blue
*/

/* #include "1552.h" */
#include <stdio.h>

int main()
{
     int integer[100];
     int trigger;
     int max;
     int tmp;
     int i;
     int two_times;

     for(i = 0; i < 100; i++)
	  integer[i] = 0;
     trigger = max = two_times = 0;
     
     while(scanf("%d", &tmp)){
	  if (tmp == -1) break;
	  if (tmp == 0) trigger = 1;
	  else {
	       integer[tmp]++;
	       if (tmp > max) max = tmp;
	  }
	  
	  if (trigger){
	       for(i = 1; 2*i <= max; i++) /* should be <= */
		    if (integer[i] && integer[2*i])
			 two_times += integer[2*i]; /* duplicated numbers */
	       printf("%d\n", two_times);
	       
	       for(i = 1; i < 100; i++)
		    integer[i] = 0;
	       trigger = max = two_times = 0;
	  }
     }
     return 0;
}

